Public Class ShowDialog
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lit As System.Web.UI.WebControls.Literal

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Protected Function GetTitle() As String
        Dim title As String
        title = Request.QueryString("title")
        Return title
    End Function

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not Page.IsPostBack Then
            Dim url As String
            url = Request.QueryString("src")

            If IsNothing(url) OrElse url.Trim = "" Then
                Throw New ApplicationException("Invalid or missing parameter")
            End If
            Dim secondValue As String
            secondValue = Request.QueryString("secondValue")

            If Not (IsNothing(secondValue) OrElse secondValue.Trim = "") Then
                url += "&secondValue=" + secondValue
            End If
            'TODO:
            If (Request.RawUrl.IndexOf("CustomerOrderRetailLabelLink.aspx") > 0) Then
                url = Request.RawUrl.Substring(Request.RawUrl.IndexOf("src=") + 4)
            End If
            lit.Text = String.Format("<iframe src='{0}' align=center  name='embeddedFrame' width='100%' height='100%'>" _
                                    , Server.UrlDecode(url))
        End If
    End Sub

End Class
